{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd,xlwings as xw,订单完成_函数 as dd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "wb=xw.Book(r'c:\\Users\\UUPT\\Desktop\\应付工作\\9月\\9月代理商提现\\9月代理商提现-合并.xlsx')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1=wb.sheets('商城').range('C1:Q22').options(pd.DataFrame).value.reset_index()\n",
    "df1=df1.iloc[0:] #因为是合并单元格表头，所以从第二行开始取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "代理商结算支付=dd.通用凭证模版(dd.clm,'应付凭证',摘要=df1['摘要'],科目编码='22413002',借贷方向='借方',本币=df1['结算金额'],\n",
    "               往来单位编码=df1['往来单位编码'],往来单位=df1['往来单位']) \n",
    "\n",
    "招商支付=dd.通用凭证模版(dd.clm,'应付凭证',摘要='支付UU跑腿跑男商城代理商结算',科目编码='100207',借贷方向='贷方',本币=[df1['结算金额'].sum()])\n",
    "    \n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "凭证=pd.concat([代理商结算支付,招商支付]) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "凭证.to_clipboard()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
